<?php

$pathname = explode($_SERVER['HTTP_HOST'], url()->current())[1];

?>
<!-- BEGIN SIDEBAR -->
<div class="page-sidebar-wrapper">
    <!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing -->
    <!-- DOC: Change data-auto-speed="200" to adjust the sub menu slide up/down speed -->
    <div class="page-sidebar">
        <!-- BEGIN SIDEBAR MENU -->
        <ul class="page-sidebar-menu">
            <li class="{{ $pathname == '/admin/dashboard' ? 'active' : '' }}">
                <a href="/admin/dashboard">
                    <i class="fa fa-home"></i>
                    <span class="title">Dashboard</span>
                    <span class="selected"></span>
                </a>
            </li>


            @if($adminModules)
                @foreach($adminModules as $submodule)
                    @if ($submodule['title'])
                        <li class="heading">
                            <h3 class="uppercase">{{ $submodule['title'] }}</h3>
                        </li>
                    @endif
                    @foreach($submodule['list'] as $module)
                        <li class="{{ $pathname == $module['url'] ? 'active' : '' }}">
                            <a href="{{ $module['url'] }}">
                                <i class="{{ $module['icon'] }}"></i>
                                <span class="title">{{ $module['title'] }}</span>
                                <span class="selected"></span>
                            </a>
                        </li>
                    @endforeach
                @endforeach
            @endif
        </ul>
        <!-- END SIDEBAR MENU -->
    </div>
</div>
<!-- END SIDEBAR -->